/*
 * PaintableEdge.fx
 *
 * Created on 2011-05-22, 21:05:24
 */

package pl.elka.gis.main.view;

import pl.elka.gis.main.node.Node;
import pl.elka.gis.main.PaintingHints;
import javafx.scene.Group;
import pl.elka.gis.main.PositionCounter;
import javafx.scene.layout.HBox;
import javafx.scene.shape.Circle;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.scene.CustomNode;
import javafx.scene.shape.Line;

/**
 * @author looser
 */

public class PaintableEdge extends CustomNode{
    public var nodeFrom:Node;
    public var nodeTo:Node;
    public var hints:PaintingHints;
    public var color:Integer = 0;

    override protected function create () : javafx.scene.Node {
        Line {
                startX: PositionCounter.countXPos(nodeFrom.getX(), hints),
                startY: PositionCounter.countYPos(nodeFrom.getY(), hints),
                endX: PositionCounter.countXPos(nodeTo.getX(), hints),
                endY: PositionCounter.countYPos(nodeTo.getY(), hints)
                strokeWidth: 1,
                stroke: colors[color]
        }
    }
    public static var colors:Color[] = [
            Color.BLACK,
            Color.RED,
            Color.GREEN,
            Color.BLUE,
            Color.YELLOW,
            Color.BROWN,
            Color.MAGENTA,
            Color.ORANGE,
            Color.LIGHTGRAY,
            Color.DARKBLUE,
            Color.VIOLET,
            Color.YELLOWGREEN];
}
